/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.jims.master.modules.sync.service;

import com.jims.master.common.service.CrudService;
import com.jims.master.modules.sync.dao.DiagnosisDao;
import com.jims.master.modules.sync.entity.Diagnosis;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 诊断Service
 * @author xueyx
 * @version 2017-11-20
 */
@Service
@Transactional(readOnly = true)
public class DiagnosisService extends CrudService<DiagnosisDao, Diagnosis> {

    public List<Diagnosis> getByVisitId(Diagnosis diagnosis){
        return dao.getByVisitId(diagnosis);
    }

    /***
     * 取得病理诊断信息
     * 病理诊断有2种：1有病理诊断类型2M开头的某些诊断码，要求填写对应的病理诊断，二者都有病理号
     * @param visitId
     * @return
     */
    public List<Diagnosis> findPathologyList(String visitId){
        return dao.findPathologyList(visitId);
    }

    /***
     * 电子病历记录诊断
     * @param id
     * @return
     */
    public List<Diagnosis>  findEmrDiagnosisList(String id){
        return dao.findEmrDiagnosisList(id);
    }

    @Transactional(readOnly = false)
    public int deleteDiagnosis(String id){
        return dao.deleteDiagnosis(id);
    }
}